home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010921-20020314 / 000142_fdc@watsun.cc.columbia.edu_Sat Nov 10 09:47:54 EST 2001.msg < prev    next >
Text File  |  2020-01-01  |  2KB  |  44 lines

  1. Article: 12962 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
  3. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Hex operations in Kermit
  6. Date: 10 Nov 2001 14:48:35 GMT
  7. Organization: Columbia University
  8. Lines: 27
  9. Message-ID: <9sjeo3$6vr$1@newsmaster.cc.columbia.edu>
  10. References: <I72H7.79555$Gh2.24053794@news2.rdc1.bc.home.com>
  11. NNTP-Posting-Host: watsun.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1005403715 7163 128.59.39.2 (10 Nov 2001 14:48:35 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 10 Nov 2001 14:48:35 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12962
  16.  
  17. In article <I72H7.79555$Gh2.24053794@news2.rdc1.bc.home.com>,
  18. jens  <psh@home.com> wrote:
  19. : C-Kermit allows me to send hex code out the serial port with the OUTPUT 
  20. : \xnn command. I am looking for a way to receive hex strings, find a match 
  21. : and do a task based on what hex string was received. I tried doing this 
  22. : with MINPUT and the \xnn notation but Kermit is just splitting it's gut at 
  23. : my feable attempts at this. 
  24. :
  25. : How would I go about testing for lets say two hex strings \xaa\xab and 
  26. : \x3e\x12 and depending on which string it matches branching to a task list.
  27. MINPUT should do it:
  28.  
  29.   minput 10 {\xaa\xab} {\x3e\x12}
  30.   switch \v(minput) {
  31.     :0, echo Timed out
  32.         break
  33.     :1, echo Got AAAB
  34.         break
  35.     :2, echo 3E12
  36.         break
  37.   }
  38.  
  39. Replace the ECHO commands with whatever actions you want to take in each
  40. case.
  41.  
  42. - Frank
  43.